package com.yuyuan.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;


/**
 * 含用户部分信息的User类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_user")
public class UserDTOC {
    // 与User相同
    /**
     * 用户id
     */
    @TableId(value = "id",type = IdType.INPUT)
    private Long id;
    /**
     * 微信用户id
     */
    private String openId;
    /**
     * 用户名称
     */
    private String name;
    /**
     * 用户性别：0：男，1：女，2：保密
     */
    private Short sex = 2;
    /**
     * 密码
     */
    private String password = "";
    /**
     * 用户头像
     */
    private String icon = "icon";
    /**
     * 手机号
     */
    private String phone = "";
    /**
     * 自我介绍
     */
    private String introduce = "这个人很懒，没有自我介绍";
    /**
     * 粉丝数量
     */
    private Integer fans = 0;
    /**
     * 关注数量
     */
    private Integer followee = 0;
    /**
     * 生日
     */
    private LocalDateTime birthday;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    public UserDTOC(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public UserDTOC(Long id, String openId, String name){
        this.id = id;
        this.openId = openId;
        this.name = name;
        this.birthday = LocalDateTime.of(2022,1,1,0,0);
        this.createTime = LocalDateTime.now();
        this.updateTime = LocalDateTime.now();
    }
}
